<html>
<head>
 	<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<link rel="stylesheet" href="./lib/jquery.mobile-1.1.1.min.css" />
	<script src="./lib/jquery-1.7.1.min.js"></script>
	<script language="JavaScript" SRC="config.js"></script>
	<script src="./lib/jquery.mobile-1.1.1.min.js"></script>
	<script type="text/javascript" charset="utf-8">

function enablemaintenance()
{
	 var form=document.forms["form"];
	alert("Enable maintenanceare called");
	 if( form.maintenancecode.value == '' ) 
	 {
	   alert('Please input your maintenance code');
	   form.maintenancecode.focus();
	   return false;
	 }
	 else if(form.maintenancecode.value.length!=5)
	 {
	  	alert('code lenght must is 5 character');
	   	form.maintenancecode.focus();
	   return false;
	 }
	 else
	 {
		 alert("post data to server");
	        $.post('http://'+serverip+'/socialengine/mobileservice/maintenance/enablemaintenance', {en4_maint_code: form.maintenancecode.value},
	            function(output){
	               alert(output.result);
	               window.location.href = "maintenance.html";
	            },"json");
	 	 return true;
	 }
}
function disablemaintenance()
{
	 var form=document.forms["form"];
	alert("Disable maintenanceare called");
	 if( form.maintenancecode.value == '' ) 
	 {
	   alert('Please input your maintenance code');
	   form.maintenancecode.focus();
	   return false;
	 }
	 else if(form.maintenancecode.value.length!=5)
	 {
	  	alert('code lenght must is 5 character');
	   	form.maintenancecode.focus();
	   return false;
	 }
	 else
	 {
		 alert("post data to server");
	        $.post('http://'+serverip+'/socialengine/mobileservice/maintenance/disablemaintenance', {en4_maint_code: form.maintenancecode.value},
	            function(output){
	               alert(output.result);
	               window.location.href = "maintenance.html";
	            },"json");
	 	 return true;
	 }
}

</script>
  </head> 
<body>
<div data-role="page">
	<div data-role="header">
	<a href="index.html" data-role="button" data-icon="home" data-iconpos="notext" rel="external">Home</a>
		<h1>Maintenance</h1>
	</div><!-- /header -->
	<div data-role="content">	
 <form  name="form" id="form">
    <label for="maintenancecode">Maintenance Code </label>
    <input type="text" id="maintenancecode" name="maintenancecode" />
    <input type="button" value="Enable Maintenance Mode" onclick="enablemaintenance();" />
   	<input type="button" value="Disable Maintenance Mode" onclick="disablemaintenance();" />
</form>	
</p>		
	</div><!-- /content -->

</div><!-- /page -->
  </body>
</html>